package com.zivwu.utils;

import android.app.Application;
import android.content.Context;

/**
 * inject application context , to provider other utils
 */
public class AppUtils {
    public static final String FILE_PROVIDER = ".commutils.provider";
    private static Application mApplication;


    /**
     * Init AppUtils
     *
     * @param context context
     */
    public static void init(Context context) {
        init((Application) context.getApplicationContext());
    }


    /**
     * Init AppUtils
     *
     * @param application application
     */
    public static void init(Application application) {
        mApplication = application;
    }


    /**
     * get the context of Application Object
     *
     * @return the context
     */
    public static Application getApp() {
        if (mApplication != null)
            return mApplication;
        throw new NullPointerException("you should init first");

    }


}
